/* Copyright 203-2115 AtomWare Technology Pty Limited
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * The flowing information must be keep 
 * LawContract.java
 * lawcontract
 * 2013-7-10下午12:01:22
 * @author 屈甲康
 * QQ285799123
 * mailto:qujiakang@gmail.com
 */

package org.jackysoft.entity;

import java.util.Map;

import javax.persistence.CollectionTable;
import javax.persistence.ElementCollection;
import javax.persistence.JoinColumn;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.Type;
import org.joda.time.DateTime;


/**
 * 合同台帐
 * 
 * */
@Entity
public class LawContract extends AbstractLawContract {

	/**
	 * 
	 */
	private static final long serialVersionUID = 9109256132422959703L;

	// 收款日期
	protected DateTime payedDate;

	// 收货日期
	protected DateTime receiveDate;

	//合格度
	protected int satisfaction;
	
	//评价度
	protected int rank;

	//所属工作流实例
	protected long workflowId;
	
	//工作流名称
	protected String workflowName;
	
	protected Map<String,String> attrs;
	
	private Map<String,String> progress;
	
	private User starter;
	
	
	
	public LawContract() {
		super();
		this.setExt("doc");
		this.setName("template");
	}

	@Type(type = "jodatime")
	public DateTime getPayedDate() {
		return payedDate;
	}

	@Type(type = "jodatime")
	public DateTime getReceiveDate() {
		return receiveDate;
	}

	public void setPayedDate(DateTime payDate) {
		this.payedDate = payDate;
	}

	public void setReceiveDate(DateTime receiveDate) {
		this.receiveDate = receiveDate;
	}

	public int getRank() {
		return rank;
	}

	public void setRank(int rank) {
		this.rank = rank;
	}

	public int getSatisfaction() {
		return satisfaction;
	}

	public void setSatisfaction(int satisfaction) {
		this.satisfaction = satisfaction;
	}

	public long getWorkflowId() {
		return workflowId;
	}

	public String getWorkflowName() {
		return workflowName;
	}

	public void setWorkflowId(long workflowId) {
		this.workflowId = workflowId;
	}

	public void setWorkflowName(String workflowName) {
		this.workflowName = workflowName;
	}

	@ElementCollection
	@CollectionTable(name="Nicknames")
	public Map<String,String> getAttrs() {
		return attrs;
	}

	public void setAttrs(Map<String,String> attrs) {
		this.attrs = attrs;
	}

	@ManyToOne
	public User getStarter() {
		return starter;
	}

	public void setStarter(User starter) {
		this.starter = starter;
	}

	@ElementCollection
	@CollectionTable(name="lawprogress")
	public Map<String,String> getProgress() {
		return progress;
	}

	public void setProgress(Map<String,String> progress) {
		this.progress = progress;
	}

}
